[NSIS] Custom radio-buttom INI page via Eclipse

Posted by Omegazero on Stack Overflow See other posts from Stack Overflow or by Omegazero
Published on 2009-08-03T17:03:25Z Indexed on 2010/06/02 10:04 UTC
Read the original article Hit count: 335

Filed under:
|
|

I'm using Eclipse's create InstallOptions menu to create a custom INI page with radio-buttons for repackaging the Blackberry Desktop installer.

There are 2 sections for each type: "Internet" and "Enterprise".

I need a user to select 1 of the 2 options and depending on their selection, the page will carry over the selection chosen in the custom page, jump to the INSTFILES page, and continue onto the end.

I couldn't find any concrete documentation on getting INI pages to load in the script (I'm probably searching incorrectly), and then pass data from one page to the next (according to fields I guess?)

Any help is appreciated. Even if it's to tell me I'm blind and can't read a doc (though a link would help :) )

Here's the INI code:


; Auto-generated by EclipseNSIS InstallOptions Script Wizard
; Jul 29, 2009 5:42:56 PM

[Settings]
NumFields=7
Title=RIM BlackBerry Desktop 5.0 installation
CancelEnabled=1

[Field 1]
Type=RadioButton
Left=15
Top=28
Right=100
Bottom=38
Text=Internet
State=
Flags=NOTIFY

[Field 4]
Type=RadioButton
Left=15
Top=95
Right=100
Bottom=105
Text=Enterprise
Flags=NOTIFY

[Field 2]
Type=GroupBox
Left=0
Top=10
Right=300
Bottom=75
Text=

[Field 5]
Type=Label
Left=30
Top=42
Right=235
Bottom=52
Text=For users who are NOT on the Enterprise (Exchange) server

[Field 6]
Type=Label
Left=30
Top=111
Right=235
Bottom=121
Text=Choose this only if you are on the Exchange server

[Field 3]
Type=GroupBox
Left=0
Top=75
Right=300
Bottom=140

[Field 7]
Type=Label
Left=0
Top=0
Right=130
Bottom=10
Text=Please choose your installation method


...And here's the NSI code:


Auto-generated by EclipseNSIS Script Wizard
Jul 29, 2009 5:42:16 PM

Name "BlackBerry Desktop"

RequestExecutionLevel admin

General Symbol Definitions
!define VERSION 5.0.0.11
!define COMPANY RIM
!define URL http://www.blackberry.com

MUI Symbol Definitions
!define MUI_ICON BBD.ico
!define MUI_LICENSEPAGE_RADIOBUTTONS

Included files
!include Sections.nsh
!include MUI2.nsh

Reserved Files
ReserveFile "${NSISDIR}\Plugins\AdvSplash.dll"

Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE license.txt
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
Installer languages
!insertmacro MUI_LANGUAGE English

Installer attributes
OutFile RIM_BlackBerry_Desktop_5.0.exe
InstallDir "$TEMP\RIM BlackBerry Desktop 5.0 Setup Files"
CRCCheck on
XPStyle on
ShowInstDetails hide
VIProductVersion 5.0.0.11
VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName "BlackBerry Desktop"
VIAddVersionKey /LANG=${LANG_ENGLISH} ProductVersion "${VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyName "${COMPANY}"
VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyWebsite "${URL}"
VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion "${VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} FileDescription ""
VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright ""

Installer sections
Section /o Main SEC0000
SetOutPath $INSTDIR
SetOverwrite ifdiff
; TESTING PHASE
SectionEnd

SectionGroup /e "BlackBerry Desktop Section"
Section /o Internet SEC0001
SetOutPath $INSTDIR\DRIVERS
SetOverwrite ifdiff
; Execwait 'msiexec /i "$INSTDIR\BlackBerry USB and Modem Drivers_ENG (DM5.0b28).msi" /passive'
SetOutPath $INSTDIR
SetOverwrite ifdiff
; File /r *
; ExecWait '"$INSTDIR\Setup.exe" /S/v/qb!'
SectionEnd

Section /o Enterprise SEC0002
SetOutPath $INSTDIR\DRIVERS
SetOverwrite ifdiff
; Execwait 'msiexec /i "$INSTDIR\BlackBerry USB and Modem Drivers_ENG (DM5.0b28).msi" /passive'
SetOutPath $INSTDIR
SetOverwrite ifdiff
; File /r *
; Delete /REBOOTOK "$INSTDIR\Setup.ini"
; Rename /REBOOTOK "$INSTDIR\Setup_Enterprise.ini" "$INSTDIR\Setup.ini"
; ExecWait '"$INSTDIR\Setup.exe" /S/v/qb!'
SectionEnd
SectionGroupEnd

Section Descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC0000} $(SEC0000_DESC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC0001} $(SEC0001_DESC)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

Installer Language Strings
TODO Update the Language Strings with the appropriate translations.

LangString SEC0000_DESC ${LANG_ENGLISH} "Installation for non-Exchange/Enterprise BlackBerry Users"
LangString SEC0001_DESC ${LANG_ENGLISH} "Installation for Exchange/Enterprise BlackBerry Users"

© Stack Overflow or respective owner

Related posts about eclipse

Related posts about custom-controls